package com.media.themovieworld.screen.splash;

import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.media.themovieworld.R;
import com.media.themovieworld.activity.SplashActivity;
import com.media.themovieworld.common.fragment.MovieTaskScreen;

public class SplashScreen extends MovieTaskScreen{

	private final int TIME_DELAY = 3000;
	@Override
	protected View onCreateContentView(LayoutInflater inflater,
			ViewGroup container) {
		View v = inflater.inflate(R.layout.splash_screen, null);
		delayScreen();
		return v;
	}

	public void switchScreen(){
		if(getActivity()!=null){
			((SplashActivity)getActivity()).finishScreen();
		}
	}
	private void delayScreen(){
		Handler handler = new Handler(); 
        handler.postDelayed(new Runnable() { 
             public void run() { 
                 switchScreen();
             } 
        }, TIME_DELAY);
	}
	
}
